<!--
 * @Author: your name
 * @Date: 2021-06-29 15:36:25
 * @LastEditTime: 2021-06-29 16:11:43
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \myframe_cms\resources\views\admin\tag_list.html
-->
<div class="main-title">
  <h2>标签管理</h2>
</div>
<div class="main-section form-inline">
  <a href="/admin/tag/edit" class="btn btn-success">+ 新增</a>
</div>
<div class="main-section">
  <table class="table table-striped table-bordered table-hover">
    <thead>
      <tr>
        <th>标签名</th>
        <th>排序值</th>
        <th>显示状态</th>
        <th>操作</th>
      </tr>
    </thead>
  <tbody>
      {if $tag}
      {foreach $tag as $v}
      <tr>
        <td><a href="/admin/tag/edit?id={$v.id}">{$v.name}</a></td>
        <td>{$v.sort}</td>
        <td>{if $v.status==0}显示{else}隐藏{/if}</td>
        <td>
          <a href="/admin/tag/edit?id={$v.id}" style="margin-right:5px;">编辑</a>
          <a href="/admin/tag/delete?id={$v.id}" class="j-del text-danger">删除</a>
        </td>
      </tr>
      {/foreach}
      {else}
      <tr>
        <td colspan="6" class="text-center">列表为空</td>
      </tr>
      {/if}
    </tbody>
  </table>
  <div class="text-center">{$page_html nofilter}</div>
</div>
<script>
  main.menuActive('tag');
  $('.j-del').click(function() {
    if (confirm('您确定要删除此项？')) {
      main.ajaxPost($(this).attr('href'), function() {
        main.contentRefresh();
      });
    }
    return false;
  });
</script>